package com.slanmao.service.impl;

import com.slanmao.common.entity.InputMessage;
import com.slanmao.mapper.MsgMapper;
import com.slanmao.service.MsgService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <CODE>MsgServiceImpl</CODE>
 *
 * @author fenrir
 * @Date 19-3-5
 */
@Service
public class MsgServiceImpl implements MsgService {

    @Autowired
    MsgMapper msgMapper;


    @Override
    public int insert(InputMessage inputMessage) {
        return msgMapper.insert(inputMessage);
    }

    @Override
    public List<InputMessage> list(int start,int size) {
        Map<String,Integer> param = new HashMap<>(2);
        param.put("start",start);
        param.put("size",size);
        return msgMapper.list(param);
    }

    @Override
    public int count() {
        return msgMapper.count();
    }

    @Override
    public List<InputMessage> listLocationMsg(int start, int size) {
        Map<String,Integer> param = new HashMap<>(2);
        param.put("start",start);
        param.put("size",size);
        return msgMapper.listLocationMsg(param);
    }

    @Override
    public Integer locationMsgCount() {
        return msgMapper.locationMsgCount();
    }
}
